package com.zhu.function;

import com.alibaba.fastjson.JSONObject;
import org.apache.flink.streaming.api.functions.ProcessFunction;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.Serializable;
import java.util.Properties;

/**
 * python脚本配置模板
 */
public abstract class PythonScriptExecuteProcessFunction extends ProcessFunction<JSONObject,JSONObject> implements Serializable {

    //配置对象
   public static Properties properties;

    public static Properties getPythonProperties() throws IOException {
        if (properties == null){
            properties = new Properties();
            properties.load(new FileInputStream("D:\\java\\NLP\\Flink-realtimeProcess\\src\\main\\resources\\pyscript.properties"));
            // System.out.println(properties.getProperty("pyscript.env"));
        }
        return properties;
    }
}
